import { createRouter, createWebHashHistory } from 'vue-router'
//import HomeView from '../views/HomeView.vue'
//导入自己的页面文件

import IndexVue from '../views/index.vue'
import Page1 from '../views/Page1.vue'
import Page2 from '../views/Page2'
import StudentView from "@/views/StudentView";
import TeacherView from "@/views/TeacherView";
import CourseView from "@/views/CourseView";
import GradeView from "@/views/GradeView";

//路由规则
const routes = [
  {
    path: '/',                     //路径   /代表首页
    name: 'index',                 //名称
    component: IndexVue,           //组件
    children:[
      {
        path: '/Page1',
        name: 'Page1',
        // route level code-splitting
        // this generates a separate chunk (about.[hash].js) for this route
        // which is lazy-loaded when the route is visited.
        component: Page1
      },
      {
        path: '/Page2',
        name: 'Page2',
        // route level code-splitting
        // this generates a separate chunk (about.[hash].js) for this route
        // which is lazy-loaded when the route is visited.
        component: Page2
      },
      {
        path: '/Student',
        name: 'Student',
        component: StudentView
      },
      {
        path: '/Teacher',
        name: 'Teacher',
        component: TeacherView
      },
      {
        path: '/Course',
        name: 'Course',
        component: CourseView
      },
      {
        path: '/Grade',
        name: 'Grade',
        component: GradeView
      },

    ]
  },

]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
